package com.tim.helper;


import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;

/**
 * @author Adminis
 * @date 2020年9月9日
 * DESC:
 */
@Slf4j
public class RabbitmqHelper {

	@Test
	public void printMessage() {
		ObjectMapper om = new ObjectMapper();
		om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
		om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
		Jackson2JsonMessageConverter converter = new Jackson2JsonMessageConverter(om, "*");
		Object dto = new Object();
		converter.toMessage(dto, null);
		System.out.println(converter.toMessage(dto, null));

	}
}
